package com.wk.warehouse.entity;

import javax.validation.constraints.NotNull;
import java.util.List;

/**
 * 商品分类
 */
public class ProductCategory {

	// 商品分类id
	private Integer typeId;
	// 商品分类父id
	private Integer parentId;
	// 商品分类名称
	private String typeName;
	// 商品分类描述
	private String typeDesc;
	// 商品分类编码（唯一标识）
	@NotNull(message="商品分类编码不能为null")
	private String typeCode;
	// 子分类
	private List<ProductCategory> childProductCategory;

	public ProductCategory() {}

	public ProductCategory(Integer typeId, Integer parentId, String typeName,
						   String typeDesc, String typeCode) {
		this.typeId = typeId;
		this.parentId = parentId;
		this.typeName = typeName;
		this.typeDesc = typeDesc;
		this.typeCode = typeCode;
	}

	public Integer getTypeId() {
		return typeId;
	}

	public void setTypeId(Integer typeId) {
		this.typeId = typeId;
	}

	public Integer getParentId() {
		return parentId;
	}

	public void setParentId(Integer parentId) {
		this.parentId = parentId;
	}

	public String getTypeName() {
		return typeName;
	}

	public void setTypeName(String typeName) {
		this.typeName = typeName;
	}

	public String getTypeDesc() {
		return typeDesc;
	}

	public void setTypeDesc(String typeDesc) {
		this.typeDesc = typeDesc;
	}

	public String getTypeCode() {
		return typeCode;
	}

	public void setTypeCode(String typeCode) {
			this.typeCode = typeCode;
		}

	public List<ProductCategory> getChildProductCategory() {
		return childProductCategory;
	}

	public void setChildProductCategory(List<ProductCategory> childProductCategory) {
		this.childProductCategory = childProductCategory;
	}

	@Override
	public String toString() {
		return "ProductCategory{" +
				"typeId=" + typeId +
				", parentId=" + parentId +
				", typeName='" + typeName + '\'' +
				", typeDesc='" + typeDesc + '\'' +
				", typeCode='" + typeCode + '\'' +
				", childProductCategory=" + childProductCategory +
				'}';
	}
}
